<%--
  Created by IntelliJ IDEA.
  User: cgl
  Date: 2021/6/7
  Time: 10:49
  To change this template use File | Settings | File Templates.
--%>
<%@page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'MyJsp.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel="stylesheet" type="text/css" href="css/css1/userLogin.css"/>
    <script src="js/js1/jquery-3.6.0.min.js"></script>
    <script src="js/js1/userLogin.js" type="text/javascript"></script>
    <link rel="stylesheet" href="css/shutter.css">
    <script type="text/javascript" charset="utf-8" src="//g.alicdn.com/sd/ncpc/nc.js?t=2015052012"></script>

</head>

<body  style="background-color: white;">
<br />
<!--标题栏-->
<div class="head-frame">
    <div class="head-panel">
        <img src="img/logo.png" />
        <div class="search">
            <input class="search-field" type="text" />
            <img src="img/icon_search.png" />
        </div>
        <div class="ctrl">
            <c:if test="${User== null }">
                <div class="my12306">我的12306</div>
                <div class="line"></div>
                <div class="font">登录</div>
                <div class="font" onclick="tosign()">注册</div>
            </c:if>
            <c:if test="${User!= null }">
                <div class="my12306" style="float: right">亲爱的用户,${User.userName}</div>
                <a href="login/toupdate" style="color: #0f0f0f">我的账户</a>
                <div class="font" style="float: right" onclick="tcdl()">退出登录</div>
            </c:if>
            <script type="text/javascript">
                function tcdl() {
                    location="login/tcdl";
                }
                function tosign() {
                    location="login/tosign";
                }
                function toshouye() {
                    location="login/Login";
                }
                function toPiao() {
                    location="train/toTrain";
                }
            </script>
        </div>
    </div>
</div>
<br />
<!--菜单栏-->
<div class="menu-frame">
    <div class="menu-panel">
        <div class="menuValue item" onclick="toshouye()">首页</div>
        <div class="menuValue " onclick="toPiao()">车票</div>
        <div class="menuValue">团购服务</div>
        <div class="menuValue">会员服务</div>
        <div class="menuValue">车站服务</div>
        <div class="menuValue">商旅服务</div>
        <div class="menuValue">出行指南</div>
    </div>
</div>
<!--背景图-->
<div class="bg-frame">
    <div class="bg-panel">
        <img src="images/banner1.jpg" height="400px" weight="1500px">
        <c:if test="${User == null }">
         <div  id="dlzc" class="login-frame" style="position: absolute;left: 100px;height:300px">
            <div class="login-item">
                <div class="zh">账号登录</div>
            </div>
            <div class="login-field" >
                <input id="userName" class="field" name="name"  type="text" placeholder="用户名/邮箱/手机号" style="width: 250px"/>
                <input  id="userPwd" class="field" name="pwd" type="password" placeholder="密码" style="width: 250px"/>
                <div id="your-dom-id" class="nc-container"></div>
                <div class="btn"><button  id="login" disabled="disabled" style="width: 250px" onclick="tologin()">立即登录</button>
                </div>
             </div>
                <div class="label">
                    <div class="label-font" style="margin: 0 auto" onclick="tosign()">注册12306账号 </div>

              </div>
           </div>
        </c:if>
    </div>
</div>
<script type="text/javascript">
    function tologin() {
        var name=$("#userName").val()
        var pwd=$("#userPwd").val();
        $.post("login/in",{name:name,pwd:pwd},function (date) {
           if(date==0){
               alert("该用户不存在");
           }else if(date==1){
               alert("密码错误")
           }else if(date==3){
               location="login/Login";
           }else if(date==2){
               location='maneger';
           }else{
               alert("发生未知错误，请刷新后重试");
           }
        });
    }
</script>
<br />
<!--重点旅客预约-->
<div class="car-frame">
    <div class="car-panel">
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
        <div>
            <img src="img/car.png" />
            <div>重点车辆预约</div>
        </div>
    </div>
</div>

<!--图片层1-->
<br /><br /><br /><br />
<div class="pic1-frame">
    <div class="pic1-panel">
        <img class="pic1" src="img/abanner01.jpg" />
        <img class="pic1" src="img/abanner02.jpg" />
    </div>
</div>
<!--图片层2-->
<br /><br /><br /><br /><br />
<div class="pic2-frame">
    <div class="pic2-panel">
        <img class="pic2" src="img/abanner03.jpg" />
        <img class="pic2" src="img/abanner04.jpg" />
    </div>
</div>
<!--备注-->
<br /><br /><br />
<div class="other" style="background-color: white;">
    <div class="o1">版权所有O2008-2018中国铁路信息科技有限责任公司中国铁道科学研究院集团有限公司</div>
    <div>京CP备15003716号-3[CP证150437号</div>
</div>
</body>
<script type="text/javascript" >
    var nc_token = ["CF_APP_1", (new Date()).getTime(), Math.random()].join(':');
    var NC_Opt =
        {
            renderTo: "#your-dom-id",
            appkey: "CF_APP_1",
            scene: "register",
            token: nc_token,
            customWidth: 250,
            trans:{"key1":"code0"},
            elementID: ["usernameID"],
            is_Opt: 0,
            language: "cn",
            isEnabled: true,
            timeout: 3000,
            times:5,
            apimap: {
                // 'analyze': '//a.com/nocaptcha/analyze.jsonp',
                // 'get_captcha': '//b.com/get_captcha/ver3',
                // 'get_captcha': '//pin3.aliyun.com/get_captcha/ver3'
                // 'get_img': '//c.com/get_img',
                // 'checkcode': '//d.com/captcha/checkcode.jsonp',
                // 'umid_Url': '//e.com/security/umscript/3.2.1/um.js',
                // 'uab_Url': '//aeu.alicdn.com/js/uac/909.js',
                // 'umid_serUrl': 'https://g.com/service/um.json'
            },
            callback: function call(data) {
                window.console && console.log(nc_token);
                window.console && console.log(data.csessionid);
                window.console && console.log(data.sig);
                document.getElementById("login").disabled="";
                //在这里写滑动成功以后，可以做的事件，下面是我写的成功之后可以注册的语句，可以改成自己需要的
                /* var uname=checkName();
                 var pwd=checkpwd();
                 var apwd=checkapwd();
                 if(uname&&pwd&&apwd){
                     document.getElementById("regist").disabled="";
                     return true;
                 }
                 else{
                     alert("答应我先填完资料ok?");
                     window.location.reload();
                     return false;
                 }*/
            }

        };
    var nc = new noCaptcha(NC_Opt);
    nc.upLang('cn', {
        _startTEXT: "请按住滑块，拖动到最右边",
        _yesTEXT: "验证通过",
        _error300: "哎呀，出错了，点击<a href=\"javascript:__nc.reset()\">刷新</a>再来一次",
        _errorNetwork: "网络不给力，请<a href=\"javascript:__nc.reset()\">点击刷新</a>",
    });
</script>
</html>

